﻿<%@ Page Language="C#" AutoEventWireup="true" CodeFile="ERP_CustomerEdit.aspx.cs" Inherits="CRM_Manager_ERP_CustomerEdit" %>

<%@ Register Assembly="Ext.Net" Namespace="Ext.Net" TagPrefix="ext" %>

<!DOCTYPE html>

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title></title>
    <link href="../css/PageStyle.css" rel="stylesheet" type="text/css" />
    <script type="text/javascript" src="../JavaScript/Common.js"></script>
    <script type="text/javascript">
        function checkother() {
            var val = exttxtf_Email.getValue();
            if (val != "") {
                var a = /^([a-zA-Z0-9_\.\-])+\@(([a-zA-Z0-9\-])+\.)+([a-zA-Z0-9]{2,4})+$/.test(val);
                if (!a) {
                    Ext.Msg.alert('系统提示', '请输入正确的邮箱地址');
                    return false;
                }
            }
            return true;
        }

        function SaveClick(type) {
            var validR = dataForm.form.isValid();
            var checkR = FieldEmptyCheck2Trim(dataForm) && checkother();
            if (validR && checkR)
            {
                Ext.net.DirectMethods.SaveData(type);
            }
        }


        function closeWin() {
            var p = parent.Ext.getCmp('popwingy');
            if (p) {
                Closepopwin();
            } else {
                closeCurrTab();
            }
        }

    </script>

</head>
<body>
    <form id="form1" runat="server">
        <ext:ResourceManager ID="ResourceManager1" runat="server" AjaxViewStateMode="Enabled" />
        <ext:Viewport runat="server" Layout="FitLayout">
            <Content>
                <ext:Panel ID="Panel1" runat="server" Layout="FitLayout" Border="false" Padding="5">
                    <TopBar>
                        <ext:Toolbar ID="Toolbar1" runat="server">
                            <Items>
                                <ext:Button ID="extBtn_Save" runat="server" Text="保存" Icon="Accept">
                                    <Listeners>
                                        <Click Handler="SaveClick(0);" />
                                    </Listeners>
                                </ext:Button>
                                <ext:Button ID="extBtn_SubmitInfo" runat="server" Text="提交" Icon="FolderGo">
                                    <Listeners>
                                        <Click Handler="SaveClick(1);" />
                                    </Listeners>
                                </ext:Button>
                                <ext:Button ID="extBtn_CheckInfo" runat="server" Text="审核" Icon="Lock">
                                    <Listeners>
                                        <Click Handler="SaveClick(2);" />
                                    </Listeners>
                                </ext:Button>
                                <ext:Button ID="extBtn_Close" runat="server" Text="关闭" Icon="Cancel">
                                    <Listeners>
                                        <Click Fn="closeWin" />
                                    </Listeners>
                                </ext:Button>
                            </Items>
                        </ext:Toolbar>
                    </TopBar>
                    <Items>
                        <ext:FormPanel runat="server" Border="false" ID="dataForm">
                            <Items>
                                <ext:Container runat="server" Layout="ColumnLayout" Height="52">
                                    <Items>
                                        <ext:Container runat="server" LabelAlign="Right" Layout="FormLayout" ColumnWidth="0.33">
                                            <Items>
                                                <ext:TextField runat="server" ID="exttxtf_CustomerName" FieldLabel="客户名称" AllowBlank="false" AnchorHorizontal="0.95" MsgTarget="Side">
                                                    <DirectEvents>
                                                        <Blur OnEvent="OnNameBlur">
                                                            <ExtraParams>
                                                                <ext:Parameter Name="targetField" Value="exttxtf_Spell" />
                                                            </ExtraParams>
                                                        </Blur>
                                                    </DirectEvents>
                                                </ext:TextField>
                                                <ext:TextField runat="server" ID="exttxtf_Linkman" FieldLabel="联系人" AllowBlank="false" MsgTarget="Side" AnchorHorizontal="0.95" />
                                            </Items>
                                        </ext:Container>
                                        <ext:Container runat="server" LabelAlign="Right" Layout="FormLayout" ColumnWidth="0.33">
                                            <Items>
                                                <ext:TextField runat="server" ID="exttxtf_Spell" FieldLabel="拼音码" AllowBlank="false" MsgTarget="Side" AnchorHorizontal="0.95" />
                                                <ext:TextField runat="server" ID="exttxtf_Telephone" FieldLabel="联系电话" AllowBlank="false" MsgTarget="Side" AnchorHorizontal="0.95" />
                                            </Items>
                                        </ext:Container>
                                        <ext:Container runat="server" LabelAlign="Right" Layout="FormLayout" ColumnWidth="0.33">
                                            <Items>
                                                <ext:TextField runat="server" ID="exttxtf_Email" FieldLabel="邮箱" Vtype="email" MsgTarget="Side" AnchorHorizontal="0.95" />
                                                <ext:TextField runat="server" ID="exttxtf_Address" FieldLabel="地址" AnchorHorizontal="0.95" />
                                            </Items>
                                        </ext:Container>
                                    </Items>
                                </ext:Container>
                                <ext:Container runat="server" LabelAlign="Right" Layout="FormLayout">
                                    <Items>
                                        <ext:TextArea runat="server" ID="exttxtf_Remark" MaxLength="400" Height="50" FieldLabel="备注" AnchorHorizontal="98%" ></ext:TextArea>
                                    </Items>
                                </ext:Container>
                            </Items>
                        </ext:FormPanel>
                    </Items>
                </ext:Panel>
            </Content>
        </ext:Viewport>
    </form>
</body>
</html>
